<template>
  <div class="home">
    <h1>{{ num }}</h1>
    <button @click="add">++</button>
    <child>
      <template #first>
        <h1>这是第一插槽</h1>
      </template>
      <template #second>
        <h2>这是第二个插槽</h2>
      </template>
    </child>
  </div>
</template>

<script>
import child from "../components/child.vue";
import { ref } from "vue";
export default {
  setup() {
    const num = ref(10);
    console.log(num);
    function add() {
      num.value++;
    }
    return { num, add };
  },
  components: {
    child,
  },
};
</script>
